﻿<?php
	// 实例化一个com对象  关联word应用程序
	$word = new COM("word.application") or die("Unable to instanciate Word");
	print "实例化成功，您的当前word版本为 {$word->Version}\n";
	//将其置前
	$word->Visible = 1;
	//打开一个空文档
	$word->Documents->Add();
	//随便做些事情
	$word->Selection->TypeText("Designed By Androidyue");
	//var_dump($word->Documents);
	$word->Documents[1]->SaveAs("d:/simpletest.doc");
	//关闭 word
	$word->Quit();
	//释放对象
	//$word->Release();  加上这一句会出现问题
	$word = null;
?> 